package com.zm.campus.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

public class GetHeadersInfo {

    public static Map getHeaders(HttpServletRequest request) {
        Map map = new HashMap();
        Enumeration headerNames = request.getHeaderNames();
        while (headerNames.hasMoreElements()) {
            String key = (String) headerNames.nextElement();
            String value = request.getHeader(key);
            map.put(key, value);
        }
        return map;
    }
    public static  void  deleteAuthorization(HttpServletResponse response){
        response.setHeader("authorization","");
    }
}
